﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DAO;
using DTO;
using System.Data;

namespace BUS
{
    public class PhongBUS
    {
        public static void InsertPhong(PhongDTO dto)
        {
            PhongDAO.InsertPhong(dto);
        }
        public static void UpdatePhong(PhongDTO dto)
        {
            PhongDAO.UpdatePhong(dto);
        }
        public static void DeletePhong(PhongDTO dto)
        {
            PhongDAO.DeletePhong(dto);
        }
        public static void UpdateTinhTrangPhong(int maphong, int tinhtrang)
        {
            PhongDAO.UpdateTinhTrangPhong(maphong,tinhtrang);
        }
        public static DataTable getAllData()
        {
            return PhongDAO.GetAll();
        }
        public static DataTable GetLoaiPhongforCombobox()
        {
            return PhongDAO.GetLoaiPhongforCombobox();
        }
        public PhongDTO GetAllWithMaPhong(int maPhong)
        {
            PhongDAO dao = new PhongDAO();
            return dao.GetAllWithMaPhong(maPhong);
        }
        public static DataTable PhongTheoTen(string tenphong)
        {
            return PhongDAO.PhongTheoTen(tenphong);
        }
        //************************************************//
        //Author:Nguyen Tan Phat
        //MSSV:1173025
        //Class:11HT
        #region
        public static DataSet SelectAll()
        {
            return PhongDAO.SelectAll();
        }
        public static DataSet SelectCobobox(int MaLoaiPhong)
        {
            return PhongDAO.SelectCombobox(MaLoaiPhong);
        }
        public static DataSet SelectWithTinhTrang(int tinhTrang)
        {
            return PhongDAO.SelectWithTinhTrang(tinhTrang);
        }
        public static void Update(PhongDTO PHONG)
        {
            PhongDAO.Update(PHONG);
        }
        public static DataSet Search(PhongDTO PHONG,int donGiaTren,int donGiaDuoi)
        {
            return PhongDAO.Search(PHONG, donGiaTren, donGiaDuoi);
        }
        #endregion
        //************************************************//
    }
}
